/** 该文件仅存放教练模块相关的接口API */
import myaxios from "../MyAxios";
// 引入路径前缀
import BASEURL from '../BaseUrl'
const { BMDURL } = BASEURL

const coachApi = {
    /**
      * 新增教练
      * @param {Object}} params  {nickname,headpic,project,introduction,achieve}
      */
    coachAdd(params) {
        return myaxios.post(BMDURL + "/v1/coach/coach_add", params)
    },

    /**
     * 删除教练
     * @param {Object}} params  {coach_id}
     */
    coachDelete(params) {
        return myaxios.post(BMDURL + "/v1/coach/coach_delete", params)
    },

    /**
     * 修改教练信息
     * @param {Object}} params  {coach_id,nickname,haedpic,introduction,project,achieve}
     */
    updateDelete(params) {
        return myaxios.post(BMDURL + "/v1/coach/update", params)
    },

    /**
     * 查询所有教练
     * @param {Object}} params  {}
     */
    listCoaches(params) {
        return myaxios.get(BMDURL + "/v1/coach/coaches", params)
    },

    /**
     * 通过id查询教练
     * @param {Object}} params  {coach_id}
     */
    listCoachById(params) {
        return myaxios.get(BMDURL + "/v1/coach/coachById", params)
    },

    /**
     * 查询教练的课程
     * @param {Object}} params  {coach_id}
     */
    listCoachCourse(params) {
        return myaxios.get(BMDURL + "/v1/coach/coach_courses", params)
    },
}

export default coachApi;